<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>员工管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
  <script src="/layui/layui.js" charset="utf-8"></script>
  <script src="/js/jquery-1.12.3.min.js" charset="utf-8"></script>
</head>
<body>

<br>
<form class="layui-form" action="" id="form1">
  <div class="layui-form-item">
    <label class="layui-form-label">工号</label>
    <div class="layui-input-block">
      <input type="text" name="no" id="no" lay-verify="required" lay-reqtext="工号是必填项，岂能为空？" autocomplete="off"  class="layui-input" style="width:300px;">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-block">
      <input type="text" name="name" id="name" lay-verify="required" lay-reqtext="姓名是必填项，岂能为空？"  autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>
 
  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <input type="radio" name="sex" value="0" title="男">
      <input type="radio" name="sex" value="1" title="女" >
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">手机</label>
    <div class="layui-input-block">
      <input type="text" name="phone" id="phone" lay-verify="required|phone" lay-reqtext="联系电话是必填项，岂能为空？"  autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">身份证地址</label>
    <div class="layui-input-block">
      <input type="text" name="address1" id="address1" lay-verify="required" lay-reqtext="身份证地址是必填项，岂能为空？"  autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">住址</label>
    <div class="layui-input-block">
      <input type="text" name="address2" id="address2" lay-verify="required" lay-reqtext="住址是必填项，岂能为空？" autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">职务</label>
    <div class="layui-input-block">
      <input type="text" name="zhiwu" id="zhiwu" lay-verify="required" lay-reqtext="职务是必填项，岂能为空？" autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>

    <div class="layui-form-item">
    <label class="layui-form-label">初始密码</label>
    <div class="layui-input-block">
      <input type="text" name="password" id="password" lay-verify="required" lay-reqtext="密码为登录系统使用，是必填项不能为空" autocomplete="off" class="layui-input" style="width:200px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">入职时间</label>
    <div class="layui-input-block">
      <input type="date" name="jobtime" id="jobtime" lay-verify="required" lay-reqtext="入职时间是必填项，岂能为空？" autocomplete="off" class="layui-input" style="width:200px;">
    </div>
  </div>


  <div class="layui-form-item">
    <label class="layui-form-label">学历</label>
    <div class="layui-input-block">
      <input type="radio" name="xueli" value="0" title="初中" >
      <input type="radio" name="xueli" value="1" title="高中" >
      <input type="radio" name="xueli" value="2" title="技工" >
      <input type="radio" name="xueli" value="3" title="大专">
      <input type="radio" name="xueli" value="4" title="本科" >
      <input type="radio" name="xueli" value="5" title="硕士" >
      <input type="radio" name="xueli" value="6" title="博士" >
    </div>
  </div>


    <div class="layui-form-item">
    <label class="layui-form-label">专业</label>
    <div class="layui-input-block">
      <input type="text" name="major" id="major"   autocomplete="off" class="layui-input" style="width:300px;">
    </div>
  </div>

    <div class="layui-form-item">
    <label class="layui-form-label">毕业时间</label>
    <div class="layui-input-block">
      <input type="date" name="gradetime" id="gradetime"  autocomplete="off" class="layui-input" style="width:200px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">职称</label>
    <div class="layui-input-block">
      <input type="radio" name="zhicheng" value="0" title="初级" >
      <input type="radio" name="zhicheng" value="1" title="中级" >
      <input type="radio" name="zhicheng" value="2" title="高级" >
      <input type="radio" name="zhicheng" value="3" title="无">
    </div>
  </div>


  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">简历</label>
    <div class="layui-input-block">
      <textarea name="introduce" id="introduce" placeholder="个人简历" class="layui-textarea"></textarea>
    </div>
  </div>

  <input type="hidden" name="id" id="id">

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="edit">修改</button>
    </div>
  </div>
</form>
 <br>

<script>
layui.use(['form'], function(){
  var form = layui.form
  ,layer = layui.layer;

  //监听提交
  form.on('submit(edit)', function(data){
    var userInfo = data.field;
    var url = "{:url('goods/editSave')}";
    $.ajax({
        url:url,
        type:'post',
        data:userInfo,
        success:function(data){
                layer.msg(data, {
                    icon: 6,//成功的表情
                    time: 1000 //1秒关闭（如果不配置，默认是3秒）
                }, function(){
                   parent.location.reload();
                });
                
        },
    });
    return false;
  });
});



</script>

</body>
</html>